import http from "../common/http.js";

/**
 * @des 用户后台中心
 */
export function storeAdminStoreInfo(data, needLoading) {
  return http.POST("/store-admin/store-info", data, needLoading);
}

/**
 * @des 商品操作
 */
export function storeAdminGoodsList(data, needLoading) {
  return http.GET("/store-admin/goods-list", data, needLoading);
}

export function storeAdminSetGoodsStatus(data, needLoading) {
  return http.POST("/store-admin/set-goods-status", data, needLoading);
}

export function storeAdminGoodsDel(data, needLoading) {
  return http.POST("/store-admin/goods-del", data, needLoading);
}

export function storeAdminSetGoodsName(data, needLoading) {
  return http.POST("/store-admin/set-goods-name", data, needLoading);
}

export function storeAdminGetGoodsAttr(data, needLoading) {
  return http.POST("/store-admin/get-goods-attr", data, needLoading);
}

export function storeAdminSetGoodsPrice(data, needLoading) {
  return http.POSTJSON("/store-admin/set-goods-price", data, needLoading);
}

export function storeAdminSaveGoods(data, needLoading) {
  return http.POSTJSON("/store-admin/save-goods", data, needLoading);
}

export function storeAdminGetGoodsEdit(data, needLoading) {
  return http.GET("/store-admin/get-goods-edit", data, needLoading);
}

export function getPostageData(data, needLoading) {
  return http.GET("/store-admin/get-postage-data", data, needLoading);
}

/**
 * @des 商品分类
 */
export function storeAdminCatList(data, needLoading) {
  return http.POST("/store-admin/cat-list", data, needLoading);
}

export function storeAdminCatSave(data, needLoading) {
  return http.POSTJSON("/store-admin/cat-save", data, needLoading);
}

export function storeAdminSetCatStatus(data, needLoading) {
  return http.POSTJSON("/store-admin/set-cat-status", data, needLoading);
}

/**
 * @des 订单管理
 */
export function storeAdminOrderList(data, needLoading) {
  return http.GET("/store-admin/order-list", data, needLoading);
}

export function storeAdminOrderRefund(data, needLoading) {
  return http.GET("/store-admin/order-refund", data, needLoading);
}

export function storeAdminOrderCancel(data, needLoading) {
  return http.POST("/store-admin/order-cancel", data, needLoading);
}

export function storeAdminOrderDetail(data, needLoading) {
  return http.POST("/store-admin/order-detail", data, needLoading);
}

export function storeAdminOrderRefundApply(data, needLoading) {
  return http.POST("/store-admin/order-refund-apply", data, needLoading);
}

/**
 * @des 快递发货
 */
export function storeAdminGetExpress(data, needLoading) {
  return http.POST("/store-admin/get-express", data, needLoading);
}

export function storeAdminOrderSend(data, needLoading) {
  return http.POST("/store-admin/order-send", data, needLoading);
}

/**
 * @des 售后地址管理
 */
// 地址列表
export function storeAdminRefundAddress(data, needLoading) {
  return http.POST("/store-admin/refund-address", data, needLoading);
}

// 添加编辑
export function storeAdminRefundAddressSave(data, needLoading) {
  return http.POST("/store-admin/refund-address-save", data, needLoading);
}

// 删除
export function storeAdminRefundAddressDel(data, needLoading) {
  return http.POST("/store-admin/refund-address-del", data, needLoading);
}

// 设置默认
export function storeAdminRefundAddressDefault(data, needLoading) {
  return http.POST("/store-admin/refund-address-default", data, needLoading);
}

// 设置售后
export function storeAdminSetRefundAddress(data, needLoading) {
  return http.POST("/store-admin/set-refund-address", data, needLoading);
}

// 获取详情
export function storeAdminGetAddressInfo(data, needLoading) {
  return http.POST("/store-admin/get-address-info", data, needLoading);
}

/**
 * @des 评论
 */
// 评论商品列表
export function orderCommentGoodsList(data, needLoading) {
  return http.GET("/store-admin/order-comment-goods-list", data, needLoading);
}

// 评论列表
export function orderCommentList(data, needLoading) {
  return http.GET("/store-admin/order-comment-list", data, needLoading);
}

// 删除评论
export function commentDel(data, needLoading) {
  return http.POST("/store-admin/comment-del", data, needLoading);
}

// 回复评论
export function commentReply(data, needLoading) {
  return http.POST("/store-admin/comment-reply", data, needLoading);
}

/**
 * @des 商城店铺数据
 */
// 商城头部数据
export function getYesData(data, needLoading) {
  return http.POST("/store-admin/get-yes-data", data, needLoading);
}

// 商城头部数据
export function shopData(data, needLoading) {
  return http.POST("/store-admin/shop-data", data, needLoading);
}

/**
 * @des 商城店铺数据
 */
export function getStoreInfo(data, needLoading) {
  return http.GET("/store-admin/get-store-info", data, needLoading);
}

export function setStoreInfo(data, needLoading) {
  return http.POST("/store-admin/get-store-info", data, needLoading);
}

export function login(data, needLoading) {
  return http.POST("/store-admin/login", data, needLoading);
}

// 修改价格
export function modifyPrice(data, needLoading) {
  return http.POST("/order/modify-price", data, needLoading);
}

export function checkLogin(data, needLoading) {
  return http.POST("/merchant/merchant-info/check-login", data, needLoading);
}
